home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2357 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  730 b 

  1. Path: rintintin.Colorado.EDU!woodjr
  2. From: woodjr@rintintin.Colorado.EDU (WOOD  JAMEY RYAN)
  3. Newsgroups: comp.lang.c
  4. Subject: cpp question
  5. Date: 20 Jan 1996 21:19:37 GMT
  6. Organization: University of Colorado, Boulder
  7. Message-ID: <4drm99$j0m@peabody.colorado.edu>
  8. NNTP-Posting-Host: rintintin.colorado.edu
  9.  
  10. I have something like this:
  11.  
  12.      #define USERLEN 8
  13.      #define HOSTLEN 15
  14.  
  15.      char name[] = "woodjr";
  16.      char host[] = "really.long.hostname.com";
  17.      char s[100];
  18.  
  19.      sprintf(s, "%.USERLENs@%.HOSTLENs", name, host);
  20.  
  21. And I want cpp to parse the sprintf line to:
  22.  
  23.      sprintf(s, "%.8s@%.15s", name, host);
  24.  
  25. Which it (of course) isn't doing.  Is there some syntax I
  26. can use to get it to do this?
  27.  
  28. Thankyou,
  29. Jamey Wood
  30.